Repository navigation
Conversation
…#9) googlesqlite models creation_time as a STRING column. Cast it to TIMESTAMP when a query reads it from INFORMATION_SCHEMA.TABLES, which fixes both the reported column type and comparisons against timestamp literals. Ownership note: the underlying schema lives in googlesqlite; until it is fixed upstream, the emulator applies the cast at query rewrite time. Refs #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
INFORMATION_SCHEMA.TABLES.creation_timeis declared asSTRINGin googlesqlite, so the emulator reported a string column and comparisons such ascreation_time > TIMESTAMP('2020-01-01')failed with a type error.The query is now rewritten to cast
creation_timetoTIMESTAMPwherever it is read fromINFORMATION_SCHEMA.TABLES. This fixes both the reported result schema and typed comparisons. Ownership: the underlying schema lives in googlesqlite (internal/info_schema.go); until it is corrected upstream, the emulator applies the cast at query rewrite time.Changes
internal/contentdata/repository.go: query rewrite forcreation_timein INFORMATION_SCHEMA.TABLES queries.server/server_test.go:TestInformationSchemaTablesCreationTimeIsTimestampasserts theTIMESTAMPschema type and a successful comparison query returning rows.Verification
go test ./server ./internal/... ./types— all green.Stack
Rung 4, based on
stack/03-numeric-params(PR #14). Next: #11 (CREATE SNAPSHOT TABLE).Refs #9